/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package testing;

import clasificador.genetico.HandOfGod;
import clasificador.genetico.PoliticaCruce;
import clasificador.genetico.PoliticaMezclaElitista;
import java.util.ArrayList;

/**
 *
 * @author Simply
 */
public class TestGenetic {
    public static void main(String[] args) {
        PoliticaCruce<ArrayList<Character>> cruce = new CruceString();
        EmparejamientoString e = new EmparejamientoString();

        ArrayList<Character> target = new ArrayList<Character>();
        for(Character c : "van dos y se cae el de en medio".toLowerCase().toCharArray())
        {
            target.add(c);
        }
        Fitness f = new Fitness(target);
        MutacionString m = new MutacionString(0.25);
        Eugenics s = new Eugenics(1000);
        HandOfGod<ArrayList<Character>> hog;

        ArrayList<ArrayList<Character>> pop = new ArrayList<>();
        for( int i = 0; i < 1000; i++ ) {
            pop.add(new ArrayList<Character>());
        }

        hog = new HandOfGod<ArrayList<Character>>(f, pop, new PoliticaMezclaElitista(e, cruce, 0.02), m, s);
        for( int i = 0; i < 100000; i++ ) {
            hog.iterate();
            hog.reckoning();
        }
    }
}
